
#include <gtk/gtk.h>
#include "public.h"

int dlg_ok(GtkWindow *window, char *msg)
{
	GtkWidget *dialog;
	int result;

	dialog=gtk_message_dialog_new(window, GTK_DIALOG_DESTROY_WITH_PARENT,
			GTK_MESSAGE_INFO,GTK_BUTTONS_OK, msg);
	result = gtk_dialog_run(dialog);
	gtk_widget_destroy(dialog);

	return result;
}

int dlg_close(GtkWindow *window, char *msg)
{
	GtkWidget *dialog;
	int result;

	dialog=gtk_message_dialog_new(window, GTK_DIALOG_DESTROY_WITH_PARENT,
			GTK_MESSAGE_INFO,GTK_BUTTONS_CLOSE, msg);
	result = gtk_dialog_run(dialog);
	gtk_widget_destroy(dialog);

	return result;
}

int dlg_cancel(GtkWindow *window, char *msg)
{
	GtkWidget *dialog;
	int result;

	dialog=gtk_message_dialog_new(window, GTK_DIALOG_DESTROY_WITH_PARENT,
			GTK_MESSAGE_INFO,GTK_BUTTONS_CANCEL, msg);
	result = gtk_dialog_run(dialog);
	gtk_widget_destroy(dialog);

	return result;
}

int dlg_yes_no(GtkWindow *window, char *msg)
{
	GtkWidget *dialog;
	int result;

	dialog=gtk_message_dialog_new(window, GTK_DIALOG_DESTROY_WITH_PARENT,
			GTK_MESSAGE_INFO,GTK_BUTTONS_YES_NO, msg);
	result = gtk_dialog_run(dialog);
	gtk_widget_destroy(dialog);

	return result;
}

int dlg_ok_cancel(GtkWindow *window, char *msg)
{
	GtkWidget *dialog;
	int result;

	dialog=gtk_message_dialog_new(window, GTK_DIALOG_DESTROY_WITH_PARENT,
			GTK_MESSAGE_INFO,GTK_BUTTONS_OK_CANCEL, msg);
	result = gtk_dialog_run(dialog);
	gtk_widget_destroy(dialog);

	return result;
}

